/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_master_outlet")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosMasterOutlet.findAll", query = "SELECT p FROM PosMasterOutlet p"),
//    @NamedQuery(name = "PosMasterOutlet.findBySync", query = "SELECT p FROM PosMasterOutlet p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosMasterOutlet.findByOutletId", query = "SELECT p FROM PosMasterOutlet p WHERE p.outletId = :outletId"),
//    @NamedQuery(name = "PosMasterOutlet.findByOutletName", query = "SELECT p FROM PosMasterOutlet p WHERE p.outletName = :outletName"),
//    @NamedQuery(name = "PosMasterOutlet.findByOutletAddress", query = "SELECT p FROM PosMasterOutlet p WHERE p.outletAddress = :outletAddress"),
//    @NamedQuery(name = "PosMasterOutlet.findByOutletPhone", query = "SELECT p FROM PosMasterOutlet p WHERE p.outletPhone = :outletPhone"),
//    @NamedQuery(name = "PosMasterOutlet.findByOutletEmail", query = "SELECT p FROM PosMasterOutlet p WHERE p.outletEmail = :outletEmail"),
//    @NamedQuery(name = "PosMasterOutlet.findByOutletContact", query = "SELECT p FROM PosMasterOutlet p WHERE p.outletContact = :outletContact"),
//    @NamedQuery(name = "PosMasterOutlet.findByOutletContactPhone", query = "SELECT p FROM PosMasterOutlet p WHERE p.outletContactPhone = :outletContactPhone"),
//    @NamedQuery(name = "PosMasterOutlet.findByOutletContactEmail", query = "SELECT p FROM PosMasterOutlet p WHERE p.outletContactEmail = :outletContactEmail")})
public class PosMasterOutlet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "outlet_id")
    private Integer outletId;
    @Column(name = "outlet_name")
    private String outletName;
    @Column(name = "outlet_address")
    private String outletAddress;
    @Column(name = "outlet_phone")
    private String outletPhone;
    @Column(name = "outlet_email")
    private String outletEmail;
    @Column(name = "outlet_contact")
    private String outletContact;
    @Column(name = "outlet_contact_phone")
    private String outletContactPhone;
    @Column(name = "outlet_contact_email")
    private String outletContactEmail;
    @Lob
    @Column(name = "outlet_description")
    private String outletDescription;
    
    @JoinColumn(name = "outlet_regional_id", referencedColumnName = "regional_id")
    @ManyToOne(optional = false)
    private PosMasterRegional outletRegionalId;

    public PosMasterOutlet() {
    }

    public PosMasterOutlet(Integer outletId) {
        this.outletId = outletId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getOutletId() {
        return outletId;
    }

    public void setOutletId(Integer outletId) {
        this.outletId = outletId;
    }

    public String getOutletName() {
        return outletName;
    }

    public void setOutletName(String outletName) {
        this.outletName = outletName;
    }

    public String getOutletAddress() {
        return outletAddress;
    }

    public void setOutletAddress(String outletAddress) {
        this.outletAddress = outletAddress;
    }

    public String getOutletPhone() {
        return outletPhone;
    }

    public void setOutletPhone(String outletPhone) {
        this.outletPhone = outletPhone;
    }

    public String getOutletEmail() {
        return outletEmail;
    }

    public void setOutletEmail(String outletEmail) {
        this.outletEmail = outletEmail;
    }

    public String getOutletContact() {
        return outletContact;
    }

    public void setOutletContact(String outletContact) {
        this.outletContact = outletContact;
    }

    public String getOutletContactPhone() {
        return outletContactPhone;
    }

    public void setOutletContactPhone(String outletContactPhone) {
        this.outletContactPhone = outletContactPhone;
    }

    public String getOutletContactEmail() {
        return outletContactEmail;
    }

    public void setOutletContactEmail(String outletContactEmail) {
        this.outletContactEmail = outletContactEmail;
    }

    public String getOutletDescription() {
        return outletDescription;
    }

    public void setOutletDescription(String outletDescription) {
        this.outletDescription = outletDescription;
    }

    public PosMasterRegional getOutletRegionalId() {
        return outletRegionalId;
    }

    public void setOutletRegionalId(PosMasterRegional outletRegionalId) {
        this.outletRegionalId = outletRegionalId;
    }

    
    
    
   
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (outletId != null ? outletId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosMasterOutlet)) {
            return false;
        }
        PosMasterOutlet other = (PosMasterOutlet) object;
        if ((this.outletId == null && other.outletId != null) || (this.outletId != null && !this.outletId.equals(other.outletId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return outletName;
//        return "com.buanalintas.ronsicecream.pos.entities.PosMasterOutlet[ outletId=" + outletId + " ]";
    }
    
}
